<template>
  私有成员：<br>
  <el-button @click="login" >模拟登录</el-button>
  <el-button @click="signOut" >模拟退出</el-button>
  <el-button @click="change1" >修改状态</el-button>
  <el-button @click="change2" >修改私有状态</el-button>

  <hr>
  {{state}}
  
  <hr>
    
</template>
  
<script setup lang="ts">
  import { reactive, readonly } from 'vue'

  import {
    defineStore
  } from '../../../lib/main'
 
    const state = defineStore('setup全局', () => {
      const person = reactive({
        name: 'setup 风格的全局状态'
      })

      return {
        person
      }
    }, false)

  const login = () => {
    state.person.name = '我变了'
  }
  const signOut = () => {
    
  }

  const change1 = () => {
    /**/
    
    // userState.$name = new Date().valueOf().toString()
  }
  
  const change2 = () => {
  }
</script>